package com.youseu.common.valid;

import javax.validation.Constraint;
import javax.validation.Payload;
import javax.validation.constraints.NotNull;
import java.lang.annotation.*;

import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
 * @author Tao
 * @version 1.0
 * 自定义校验注解 用于校验entity字段
 */
@Documented
@Constraint(validatedBy = {EnumConstraintValidator.class})//与自定义校验器关联
@Target({METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER, TYPE_USE})
@Retention(RUNTIME)
public @interface EnumValidate {
    String message() default "{com.youseu.common.valid.EnumValidate.message}";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};

    int[] values() default {};

    String regexp() default "";//支持正则表达式校验
}
